from common.public import *
from orm.model import Position
from view.baseview import BaseView


class PositionView(BaseView):
    def __init__(self):
        pass

    def getAllPosition(self):
        """取得所有职位"""
        positions = Position.select().order_by(Position.name.asc())
        allposition = []
        for position in positions:
            allposition.append({"id":position.id,"name":position.name})
        return super().resultSet(200, "职位列表取得成功！",  allposition)
    
